average value of the function